package com.antd.admin.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 菜单权限表
 * </p>
 *
 * @author 子丶沫
 * @since 2020-11-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_menu")
@ApiModel(value="SysMenu对象", description="菜单权限表")
public class SysMenu implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "菜单ID")
    @TableId(value = "menu_id", type = IdType.ASSIGN_ID)
    private String menuId;

    @ApiModelProperty(value = "菜单名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "菜单权限标识")
    @TableField("perms")
    private String perms;

    @ApiModelProperty(value = "前端跳转URL")
    @TableField("path")
    private String path;

    @ApiModelProperty(value = "菜单组件")
    @TableField("component")
    private String component;

    @ApiModelProperty(value = "父菜单ID")
    @TableField("parent_id")
    private String parentId;

    @ApiModelProperty(value = "图标")
    @TableField("icon")
    private String icon;

    @ApiModelProperty(value = "排序")
    @TableField("sort")
    private Integer sort;

    @ApiModelProperty(value = "菜单类型 （类型   0：目录   1：菜单   2：按钮）")
    @TableField("type")
    private Integer type;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "逻辑删除标记(0--正常 1--删除)")
    @TableField("del_flag")
    private String delFlag;

    @ApiModelProperty(value = "是否为外链")
    @TableField("is_frame")
    private Boolean isFrame;

    @ApiModelProperty(value = "是否缓存路由")
    @TableField("keep_alive")
    private Boolean keepAlive;

    @ApiModelProperty(value = "是否隐藏菜单")
    @TableField("hidden")
    private Boolean hidden;

    @ApiModelProperty(value = "重定向")
    @TableField("redirect")
    private String redirect;

    @ApiModelProperty(value = "聚合路由")
    @TableField("always_show")
    private Boolean alwaysShow;

    @ApiModelProperty(value = "菜单标题")
    @TableField("title")
    private String title=this.name;

    @ApiModelProperty(value = "父菜单名称")
    @TableField(exist = false)
    private String parentName;

    @ApiModelProperty(value = "菜单等级")
    @TableField("level")
    private Integer level;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

}
